<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    function Parent(m){
        this.msg = m;
    }
    Parent.prototype.show = function(){
        console.log(this.msg);
    }

    function Child(m){
        Parent.call(this, m);
    }
    // Child.prototype = {...Parent.prototype};
    // Child.prototype.show = function(){
    //     console.log(1123123)
    // }
    Child.prototype = new Parent();
    Child.prototype.show = function(){
        console.log(456456)
    }

    const p = new Parent("hello");
    console.log(p);
    console.log(p.msg)
    p.show();
    
    const c = new Child("world");
    console.log(c);
    console.log(c.msg)
    c.show();
</script>
</html>